<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import = "com.xiaonei.model.*,com.xiaonei.DAO.*,java.util.ArrayList,java.util.Iterator;" %>
<%
%>
<% 
	String contextPath =request.getContextPath();
	String schoolNum = (String)request.getParameter("num");
%>
<form action="<%=contextPath %>/NewPostServlet?schoolNum=<%=schoolNum %>" method="post">
	<div id =direct></div>
	<input type = "hidden" name ="schoolNum" value='<%=schoolNum %>' />
	
	
	<table>
		<tr>
			<td>发表新帖</td>
		</tr>
		<tr>
			<td>话题:
			<select  name="topic" style="width:100px;height:40px font-size:20px;">
				<%
				String type=null;
				String topic=null;
				ArrayList<String> typeList=new ArrayList<String>();
				ArrayList<String> topicList=new ArrayList<String>();
				TopicDAOImpl topicDAOImpl=new TopicDAOImpl();
				typeList=topicDAOImpl.typeList();
				int typeCount=topicDAOImpl.typeCount();
				for(int i=0;i<typeCount;i++){ 
					topicList=topicDAOImpl.toipcOfTypeList(typeList.get(i));
					
					for(int j=0;j<topicList.size();j++){ 
						topic=topicList.get(j);
				%>
						<option value = "<%=topic %>"><%out.println(topic); %></option>
				<%}} %>
			</select>
			主题:<input type="text" name="theme" style="width:500px;height:20px"></td>
		</tr>
		<tr>
			<td><textarea name='content' style ="width:988px;height:120px;algin:center;"></textarea></td>
		</tr>
		<tr>
			<td>	<input type ='submit'  value='提交'/></td>
		</tr>
	</table>
	
	
	
	

</form>